<template>
  <div class="book-center">
    <h4>全部听书</h4>
    <div class="allbook" v-for=" i in book_list" @click="booklist(i.bookid)">
      <img :src="URL + i.bookimg" alt="">
      <div>
        <h6>{{i.bookname}}</h6>
        <p>{{i.bookrecommend}}</p>
        <span>{{i.videoduration}}</span>
      </div>
    </div>
  </div>
</template>

<script>
    export default {
        name: "allLsit",
      data(){
          return{
            book_list:[],
          }
      },
      mounted(){
        let  date = new Date().getTime()//获取当前时间戳
        let obj ={page :1,rows:'10',timestamp:date,token :0,type:0}
        let sign =  this.md5(this.objKeySort(obj)+'44543e5367854cfcbb3a867f32fa64a2')//加密
        let url = 'https://testapi.readerday.com/v3/product/book/list/0/' + sign +'/'+ date +'/0/1/1/10'
        this.$axios.get(url)
          .then((res)=>{
            this.book_list=[]
            this.book_list=res.data.data.book_list

            console.log(this.book_list)
          })
      },
      methods:{
        booklist(v){
          this.$router.push({name:'particulars',params:{'id':v}})//调转详情页
        }
      }
    }
</script>

<style scoped>
  .book-center>h4{
    margin-bottom: .15rem;
    font-weight: bold;
  }
  .allbook{
    padding: 0  0.08rem;
    font-size: .12rem;
    text-align: left;
    margin-bottom: .1rem;
  }
.allbook img{
  height: 1.1rem;
  width: .85rem;
  float: left;
  margin-right: .1rem;
}
  .allbook h6{
    font-size: .14rem;
    margin-bottom: .05rem;
  }
  .allbook p{
    height: .7rem;
  }

</style>
